﻿
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>类型管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../layui/css/layui.css" media="all">
<link rel="stylesheet" href="css/myCss.css">
<script src="/static/layui/layui.js" charset="utf-8"></script>
<script src="/static/js/jquery3.4.0.js" type="text/javascript"></script>
<script type="text/javascript">
    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg);  //匹配目标参数
        if (r != null) return unescape(r[2]); return null; //返回参数值
    }
    //获取图片真实宽高
    function getImageWidth(url, callback) {
        var img = new Image();
        img.src = url;

        // 如果图片被缓存，则直接返回缓存数据
        if (img.complete) {
            callback(img.width, img.height);
        } else {
            // 完全加载完毕的事件
            img.onload = function () {
                callback(img.width, img.height);
            }
        }
    }
</script>
    
    <script type="text/javascript">

        layui.use(['form', 'util'], function () {
            var form = layui.form
            , util = layui.util;
            util.fixbar();
            
        });

        function queding(numb) {
            var index = parent.layer.confirm('你确定要删除吗？', {
                btn: ['删除', '我再想想'] //按钮
            }, function () {
                parent.layer.close(index);
                location.href = 'problemType.html?action=del&delid=' + numb;

            }, function () {
                parent.layer.close(index);
            });
        }

    </script>
</head>
<body>
    <blockquote class="layui-elem-quote">
        提示：父类 <span style="color: Red;">0</span> 为一级分类</blockquote>
    <form action="problemType.html?action=add" method="post" class="layui-form layui-form-pane">
    <input name="depth" type="hidden" value="" />
    <input name="parentType" type="hidden" value="" />
    <input name="leix" value="" type="hidden" />
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">
                父类：</label>
            <div class="layui-input-inline">
                <input type="text" name="txtparentType" value="" disabled=""
                    class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">
                类型名</label>
            <div class="layui-input-inline">
                <input type="text" name="G_name" lay-verify="required" class="layui-input" value="">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">
                排序</label>
            <div class="layui-input-block">
                <input type="number" name="G_sorting" id="date" lay-verify="number" class="layui-input"
                    value="">
            </div>
        </div>
        <div class="layui-inline">
            <button class="layui-btn" lay-submit="" lay-filter="demo2">
                提交</button>
        </div>
    </div>
    </form>
    <table class="layui-table">
        <thead>
            <tr>
                <th>
                    类型名
                </th>
                <th>
                    排序
                </th>
                <th>
                    操作
                </th>
            </tr>
        </thead>
        <tbody>
           
            <tr>
                <td>
                    分类1
                </td>
                <td>
                    1
                </td>
                <td>
                    <a class='layui-btn layui-btn-mini layui-btn-normal' href="problemType.html?depthid=1&depth=1">
                        <i class="layui-icon">&#xe61f;</i> 添加子类</a><a class="layui-btn layui-btn-mini " title="修改"
                            href="problemType.html?id=<1"><i class="layui-icon">&#xe642;</i></a><a
                                title="删除" class="layui-btn layui-btn-mini layui-btn-danger" onclick="queding(1)">
                                <i class="layui-icon">&#xe640;</i></a>
                </td>
            </tr>
           
        </tbody>
    </table>
</body>
</html>
